package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.KkCategoryMapper;
import com.ruoyi.system.domain.KkCategory;
import com.ruoyi.system.service.IKkCategoryService;

/**
 * 商城商品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-24
 */
@Service
public class KkCategoryServiceImpl implements IKkCategoryService 
{
    @Autowired
    private KkCategoryMapper kkCategoryMapper;

    /**
     * 查询商城商品分类
     * 
     * @param id 商城商品分类主键
     * @return 商城商品分类
     */
    @Override
    public KkCategory selectKkCategoryById(Integer id)
    {
        return kkCategoryMapper.selectKkCategoryById(id);
    }

    /**
     * 查询商城商品分类列表
     * 
     * @param kkCategory 商城商品分类
     * @return 商城商品分类
     */
    @Override
    public List<KkCategory> selectKkCategoryList(KkCategory kkCategory)
    {
        return kkCategoryMapper.selectKkCategoryList(kkCategory);
    }

    /**
     * 新增商城商品分类
     * 
     * @param kkCategory 商城商品分类
     * @return 结果
     */
    @Override
    public int insertKkCategory(KkCategory kkCategory)
    {
        return kkCategoryMapper.insertKkCategory(kkCategory);
    }

    /**
     * 修改商城商品分类
     * 
     * @param kkCategory 商城商品分类
     * @return 结果
     */
    @Override
    public int updateKkCategory(KkCategory kkCategory)
    {
        kkCategory.setUpdateTime(DateUtils.getNowDate());
        return kkCategoryMapper.updateKkCategory(kkCategory);
    }

    /**
     * 批量删除商城商品分类
     * 
     * @param ids 需要删除的商城商品分类主键
     * @return 结果
     */
    @Override
    public int deleteKkCategoryByIds(Integer[] ids)
    {
        return kkCategoryMapper.deleteKkCategoryByIds(ids);
    }

    /**
     * 删除商城商品分类信息
     * 
     * @param id 商城商品分类主键
     * @return 结果
     */
    @Override
    public int deleteKkCategoryById(Integer id)
    {
        return kkCategoryMapper.deleteKkCategoryById(id);
    }
}
